#include"my_head.h"

bool Searchnode(p_flight_node head)
{
    char n[20]={0};
    if(head==NULL)
    {
        printf("error\n");
        return false;
    }
    p_flight_node p=head->next;
    printf("请输入你想要查询的航班，可通过航班号/出发地/目的地/日期查询:");
    scanf("%s",n);
    while(p!=NULL&&strcmp(n,p->data.flight_Number)!=0&&
         strcmp(n,p->data.departure_Airport)!=0&&
         strcmp(n,p->data.arrival_Airport)!=0&&
         strcmp(n,p->data.flight_Schedule)!=0)
    {
        p=p->next;
    }
    if(p!=NULL)
    {
        printf("该航班号信息:%s\n",p->data.flight_Number);
        printf("该航班机型信息:%s\n",p->data.aircraft_Model);
        printf("该航班预计起飞时间信息:%s\n",p->data.departure_Time);
        printf("该航班预计降落时间信息:%s\n",p->data.arrival_Time);
        printf("该航班班期信息:%s\n",p->data.flight_Schedule);
        printf("该航班起飞机场信息:%s\n",p->data.departure_Airport);
        printf("该航班目的机场信息:%s\n",p->data.arrival_Airport);
        printf("===============\n");
        return true;
    }else
    {
        printf("未找到该航班！\n");
        printf("=============\n");
        return false;
    }

}